// 复杂的自定义覆盖物 
function ShowSitesNum(point, text){
  this._point = point;
  this._text = text;
  this._surText = "基站数";
  this._preText = "个";
}
ShowSitesNum.prototype = new BMap.Overlay();
ShowSitesNum.prototype.initialize = function(map){
  this._map = map;
  var div = this._div = document.createElement("div");
  div.style.position = "absolute";
  div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
  div.style.backgroundColor = "#ffffff";
  div.style.border = "1px solid #32b5cb";
  div.style.color = "#B1B1B1";
  div.style.height = "30px";
  div.style.padding = "2px 10PX";
  div.style.lineHeight = "30px";
  div.style.whiteSpace = "nowrap";
  div.style.MozUserSelect = "none";
  div.style.fontSize = "12px";
  
  //Sites Num
  var span = this._span = document.createElement("span");
  
  //Num char
  var span1 = this._span1 = document.createElement("span");
 
  span1.style.color = "#32b5cb";
  span1.style.fontSize = "24px";

  //char:ge
  var span2 = this._span2 = document.createElement("span");
  /*span2.style.position = "absolute";
  span2.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
  span2.style.backgroundColor = "#ffffff";
  span2.style.border = "1px solid #32b5cb";
  span2.style.color = "#B1B1B1";
  span2.style.height = "30px";
  span2.style.padding = "2px 10PX";
  span2.style.lineHeight = "30px";
  span2.style.whiteSpace = "nowrap";
  span2.style.MozUserSelect = "none";
  span2.style.fontSize = "12px";*/
  
  div.appendChild(span);
  div.appendChild(span1);
  div.appendChild(span2);
  span.appendChild(document.createTextNode(this._surText));    
  span1.appendChild(document.createTextNode(this._text));
  span2.appendChild(document.createTextNode(this._preText));
  
  //如果有问题，检查这里的map变量，百度demo中此处取得是mp全局变量，而不是方法内的map，但现在功能能实现，先这样
  map.getPanes().labelPane.appendChild(div);
  
  return div;
}
ShowSitesNum.prototype.draw = function(){
  var map = this._map;
  var pixel = map.pointToOverlayPixel(this._point);
  //设置
  this._div.style.left = pixel.x + "px";
  this._div.style.top  = pixel.y - 37 + "px";
}